import{d as r,r as u,c,e,w as i,v as p,f as d,u as f,b}from"./index-ClElxO2L.js";const h={class:"bloc w-full flex flex-col gap-y-1"},m=e("div",null,"标题",-1),_=e("div",null,[e("button",{type:"submit",class:"border px-3 py-2 bg-blue-600 border-blue-700 text-white hover:bg-blue-700"}," 提交 ")],-1),y=r({__name:"add",setup(x){const t=u(""),s=f(),a=()=>{const o=JSON.stringify({title:t.value});fetch("/api",{method:"POST",headers:{"content-type":"application/json"},body:o}).then(()=>{s.push("/")})};return(o,l)=>(b(),c("form",{class:"flex flex-col gap-y-2",autocomplete:"off",onSubmit:d(a,["prevent"])},[e("label",h,[m,i(e("input",{type:"text","onUpdate:modelValue":l[0]||(l[0]=n=>t.value=n),required:"",placeholder:"输入标题",class:"block w-full border focus:outline-none px-3 py-2"},null,512),[[p,t.value]])]),_],32))}});export{y as default};
